(function() {
  app.directive('cardInfo', function() {
    return {
      restrict: 'E',
      templateUrl: 'public/directive/card-info.html',
      replace: true,
      scope: {
        dirCards: '=dirCards'
      },
      controller: function($scope) {

      },
      link: function(scope, ele, atr) {

      }
    };
  });

  app.directive('cardLi', function() {
    return {
      restrict: 'E',
      template: '<ul>' +
        '<li ng-repeat="it in rows.content" ng-show="!it.card_li_hiden">' +
        '<span ng-bind="it.txt" ng-style="rows.css.left?rows.css.left:null"></span>' +
        '<span ng-style="it.css?(data|card_li_css_filter:it):rows.css.right" ng-bind="data[it.key]+(it.key2?\' \'+data[it.key2]:\'\')+(it.key3?\' \'+data[it.key3]:\'\')+(it.unit?\' \'+it.unit:\'\')"></span>' +
        '</li>' +
        '</ul>',
      replace: true,
      scope: {
        data: '=data',
        rows: '=rows'
      },
      controller: function($scope) {

      },
      link: function(scope, ele, atr) {

      }
    };
  });
  app.filter('card_li_css_filter', function() {
    return function(data, li) {
      return {
        color: li.css.color ? data[li.css.color] : null,
      };
    };
  });
})();
